package com.trimps.steps.service.impl;

import java.util.HashMap;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.trimps.steps.mapper.UserWalkerGroupMapper;
import com.trimps.steps.pojo.WalkerGroup;
import com.trimps.steps.service.IUserWalkerGroupService;

@Service("userWalkerGroupService")
public class UserWalkerGroupServiceImpl implements IUserWalkerGroupService {
	@Autowired
	private UserWalkerGroupMapper userWalkerGroupMapper;

    @Override
    public List<WalkerGroup> getUserWalkerGroupByUserId(int userId) {
        HashMap<String, Object> map = new HashMap<String, Object>();
        map.put("userId", userId);
        return getUserWalkerGroup(map);
    }	
    
    @Override
    public List<WalkerGroup> getUserWalkerGroup(HashMap<String, Object> map) {
        return userWalkerGroupMapper.getUserWalkerGroup(map);
    }

    @Override
    public int saveUserWalkerGroup(int userId, String[] groupIds) {
        return userWalkerGroupMapper.saveUserWalkerGroup(userId, groupIds);
    }

    @Override
    public int delByUserId(int userId) {
        return userWalkerGroupMapper.delByUserId(userId);
    }

}
